#coding=utf-8

NAME_GAME       = u"mahjong"
COUNT_HAND_NUM  = 13
E_CARD_ARR_LEN = 38

E_BAO_SCORE   = 10
E_BASE_SCORE   = 2

E_SEAT_NONE   = -1

E_PAI_HU           = 0 #胡  桌子和用户胡牌类型
E_PAI_GANG_MING     = 1 #杠
E_PAI_TOUCH         = 2 #碰
E_PAI_EAT           = 3 #吃
E_PAI_CNT           = 4 #计数
E_PAI_CABCLE        = 4 #取消

E_TYPE_GANG_NONE     = 0 #没杠   用户杠牌类型 ownGang
E_TYPE_GANG_AN       = 1 #暗杠
E_TYPE_GANG_GUODU    = 2 #过渡杠
E_TYPE_GANG_MING     = 3 #明杠

E_TIP_GANG_MING     = 0 #明杠牌    用户杠碰吃牌
E_TIP_GANG_AN       = 1 #暗杠
E_TIP_TOUCH         = 2 #碰牌
E_TIP_EAT           = 3 #吃牌
E_TIP_CNT           = 4 #计数

E_HU_TYPE_NONE      = 0#胡牌类型 流局     庄家得分
E_HU_TYPE_OWN       = 1#胡牌类型 自摸
E_HU_TYPE_CATCH     = 2#胡牌类型 抓炮
E_HU_TYPE_FOUR      = 3#胡牌类型 四牌     闲家得分

E_DISSMISS_NONE   = 0 #解散房间初始状态
E_DISSMISS_DISAGR   = 1 #解散房间不同意
E_DISSMISS_AGR    = 2 #解散房间同意

#有宝无宝显示
E_BAO_NONE      = 0 #无宝
E_BAO_HAD       = 1 #有宝
E_BAO_BLANK     = 3 #不显示





STATE_TABLE_INIT          = -1
STATE_TABLE_WAIT          = 0#等待玩家来参与游戏
STATE_TABLE_READY         = 1#准备阶段 开始游戏
STATE_TABLE_DEAL          = 2#发牌牌阶段
STATE_TABLE_PLAY          = 3#打牌阶段

STATE_TABLE_HAND          = 5#玩家手牌动画阶段

STATE_TABLE_HGPC          = 4#碰杠吃阶段
STATE_TABLE_OWNGANG       = 6#自摸杠抢胡
STATE_TABLE_RESULT        = 7#单局结算阶段

STATE_TABLE_DISMISS       = 8#解散申请阶段
STATE_TABLE_TOAllRESULT     = 9#总结算过渡阶段
STATE_TABLE_END           = 10#结束阶段 总结算




#特殊分 





STATE_USER_INIT = 0    #用户初始状态
STATE_USER_PLAY = 1    #用户开局状态
STATE_USER_OFFLINE =2  #用户断线状态

ERR_CHAT_FREQUENT   =   1
#=========================error==================================#
ERR_MJ_OK  = 2000
ERR_MJ_NO_TABLE = 2001
ERR_MJ_ALREALY_READY = 2002
#==========================================================================================

CMD_C2G_PLAY_CAR           =   101 #client->game  打牌申请
CMD_C2G_CANCEL_HANG_UP     =   102 #client->game  取消托管
CMD_C2G_HPGC               =   103 #client->game  胡碰杠吃申请
CMD_C2G_ZIMO_HU            =   104 #client->game  自摸胡申请
CMD_C2G_ZIMO_GANG          =   105 #client->game  自摸杠申请
CMD_C2G_READY              =   106 #client->game  继续准备
CMD_C2G_DISMISS_APPLY      =   107 #client->game  解散申请
CMD_C2G_DISMISS_AGREE      =   108 #client->game  解散同意
CMD_C2G_KICK               =   109 #client->game  踢出某人
CMD_C2G_VOICE_NOTIE        =   110 #client->game  语音
CMD_C2G_THROW_PROP         =   111 #client->game  扔道具
CMD_C2G_CHAT               =   112 # 语音聊天包
CMD_C2G_HANG               =   113 #client->game  托管



CMD_G2C_GET_DESK_INFO      =   200 #client->game 回复申请桌子信息
CMD_G2C_READY_START_BR     =   201#game->client  准备等待状态广播
CMD_G2C_DEAL_HAND          =   202#game->client  发牌广播
CMD_G2C_NOTICE_DOWN_BR     =   203#game->client  开始发牌广播

CMD_G2C_PLAY_CARD_BR       =   204#game->client  打牌广播

CMD_G2C_HANG_UP_BR         =   205#game->client  托管
CMD_G2C_GET_CARD_BR        =   206#game->client  摸牌广播
CMD_G2C_CANCEL_HANG_UP_BR  =   207#game->client  取消托管
CMD_G2C_NOTICE_HGPC        =   208#game->client  通知胡碰杠吃
CMD_G2C_DELAY_HGPC         =   209#game->client  回复收到吃碰杠胡取消请求
CMD_G2C_HGPC_BR            =   210#game->client  胡吃碰杠广播
CMD_G2C_HUAG_BR            =   211#game->client  黄牌广播提示
CMD_G2C_OWN_HU_BR          =   212#game->client  自摸胡牌广播
CMD_G2C_OWN_GANG_BR        =   213#game->client  自摸杠广播
CMD_G2C_RESULT_BR          =   214#game->client  结算广播
CMD_G2C_READY_BR           =   215#game->client  继续准备广播
CMD_G2C_RECONNED           =   216#game->client  重连协议
CMD_G2C_DISMISS_APPLY_BR   =   217#game->client  解散发起
CMD_G2C_DISMISS_AGR_BR     =   218#game->client    解散投票
CMD_G2C_DISMISS_RESULT_BR  =   219#game->client    解散结果广播
CMD_G2C_ALL_RESULT_BR      =   220#game->client    总结算广播
CMD_G2C_VOICE_NOTIE_BR     =   221#game->client   语音广播
CMD_G2C_THROW_PROP_BR      =   222#game->client   扔道具广播
CMD_G2C_CHAT               =   223# 语音聊天包广播
CMD_G2C_DISMISS_VOTE       =   224#game->client  解散投票弹窗信息
#CMD_G2C_VOICE_NOTIE_BR     =   225#game->client   语音广播
CMD_G2C_PLAY_START_BR      =   226#game->client   开始打牌广播


NAME_GAME                       = u"mahjong"
STATE_TABLE_INIT                = 0
STATE_TABLE_WAIT                = 1#等待玩家来参与游戏
STATE_TABLE_READY               = 2#准备阶段 开始游戏
STATE_TABLE_DEAL                = 3#发牌牌阶段
STATE_TABLE_CPGH                = 4#吃椪杠胡阶段
STATE_TABLE_BUPAI               = 5#补牌阶段


MJ_ERR_OK                       = 1000
MJ_ERR_CARD_ERROR               = 1001


MO_PAI_NORMAL                   = 1 #正常摸牌
MO_PAI_GANG                     = 2 #玩家杠了 摸牌




CMD_GAME2C_XIPAI                = 201
CMD_GAME2C_FAPAI                = 202
CMD_GAME2C_DAPAI                = 203
CMD_GAME2C_BUPAI                = 204
CMD_GAME2C_NOTICE_CPGH          = 205
CMD_GAME2C_CPGH                 = 206




if __name__ == '__main__':
    pass
